//
//  SRSleepingShareContentView.m
//  SportRing
//
//  Created by icelee on 14-10-29.
//  Copyright (c) 2014年 HotOne. All rights reserved.
//

#import "SRSleepingShareContentView.h"
#import "SREvaluateView.h"

#define NUMBER_SIZE 15
#define NUMBER_COLOR [UIColor red:245 green:249 blue:37 alpha:1.0]
#define NUMBER_COLOR1 [UIColor red:231 green:99 blue:40 alpha:1.0]

@implementation SRSleepingShareContentViewModel


@end

@interface SRSleepingShareContentView()

@property (nonatomic, weak)IBOutlet UIImageView *evaluateViewContainerView;
@property (nonatomic, weak)IBOutlet UILabel *cartoonOneLabel;
@property (nonatomic, weak)IBOutlet UILabel *cartoonTwoLabel;
@property (nonatomic, weak)IBOutlet UILabel *cartoonThreeLabel;
@property (nonatomic, weak)IBOutlet UILabel *bottomContentLabel;

@end

@implementation SRSleepingShareContentView

- (void)setSRSleepingShareContentViewData:(SRSleepingShareContentViewModel *)model
{
    //sleeping quality.
    SREvaluateView *evaluateView = [[SREvaluateView alloc]  initWithSelectedImage:[UIImage imageNamed:@"moon"] notSelectedImage:[UIImage imageNamed:@"moon_1"] notSelectedCount:5-model.sleepQuality selectedCount:model.sleepQuality];
    [self.evaluateViewContainerView addSubview:evaluateView];
    
    
    self.cartoonOneLabel.text = [NSString stringWithFormat:@"为了家庭不怕累，少睡一点无所谓"];

    NSAttributedString *cartoonTwoString = [SRHelper attString:[NSString stringWithFormat:@"昨晚晚睡了%ld小时%ld分钟",(long)[SRHelper getHoursFromTime:model.sleepTime],(long)[SRHelper getMinutesFromTime:model.sleepTime]]
                                              fromString:[[NSMutableArray alloc] initWithObjects:@"昨晚晚睡了",@"小时", nil]
                                                toString:[[NSMutableArray alloc] initWithObjects:@"小时",@"分钟", nil]
                                                fontSize:[[NSMutableArray alloc] initWithObjects:[UIFont systemFontOfSize:NUMBER_SIZE],[UIFont systemFontOfSize:NUMBER_SIZE], nil]
                                                   color:[[NSMutableArray alloc] initWithObjects:NUMBER_COLOR,NUMBER_COLOR, nil]];
    self.cartoonTwoLabel.attributedText = cartoonTwoString;
    
    NSAttributedString *cartoonThreeString = [SRHelper attString:[NSString stringWithFormat:@"翻身%ld小时%ld分钟，我实在是太辛苦了",(long)[SRHelper getHoursFromTime:model.turnBodyTime],(long)[SRHelper getMinutesFromTime:model.turnBodyTime]]
                                                    fromString:[[NSMutableArray alloc] initWithObjects:@"翻身",@"小时", nil]
                                                      toString:[[NSMutableArray alloc] initWithObjects:@"小时",@"分钟", nil]
                                                      fontSize:[[NSMutableArray alloc] initWithObjects:[UIFont systemFontOfSize:NUMBER_SIZE],[UIFont systemFontOfSize:NUMBER_SIZE], nil]
                                                         color:[[NSMutableArray alloc] initWithObjects:NUMBER_COLOR,NUMBER_COLOR, nil]];
    self.cartoonThreeLabel.attributedText = cartoonThreeString;
    
    NSAttributedString *contentString = [SRHelper attString:[NSString stringWithFormat:@"他们说我已经是高富帅了，很多人睡眠不足7小时哦。哎~且行且珍惜吧。"]
                                                      fromString:[[NSMutableArray alloc] initWithObjects:@"他们说我已经是",@"哎~", nil]
                                                        toString:[[NSMutableArray alloc] initWithObjects:@"了",@"吧。", nil]
                                                        fontSize:[[NSMutableArray alloc] initWithObjects:[UIFont systemFontOfSize:12],[UIFont systemFontOfSize:12], nil]
                                                           color:[[NSMutableArray alloc] initWithObjects:NUMBER_COLOR1,NUMBER_COLOR1, nil]];
    self.bottomContentLabel.attributedText = contentString;

//    self.bottomContentLabel.text = [NSString stringWithFormat:@"他们说我已经是高富帅了，很多人睡眠不足7小时哦。哎~且行且珍惜吧。"];
//    self.bottomContentLabel.text = model.tipText;
    
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
